% import image
image = imread('the_image.jpg');
% convert to gray
gray = rgb2gray(image);
% convert to binary
binary = dither(gray);

% error control it
% this is a rudimentary form of controlling for error
% triple every element, eg 0 => 000
[row, col] = size(binary);
sendRes = zeros(row, col*3);
currentCol = 1;
for i =(1:col)
    for a = (1:3)
        sendRes(:,currentCol) = binary(:,i);
        currentCol = currentCol + 1;
    end
end
